:root {
  --bg: #f4f6f9; --card: #fff; --ink: #1c2430; --muted: #6b7686; --line: #dde3ea;
  --brand: #0b2340; --accent: #1f6feb; --accent-ink: #fff;
  --red: #c62828; --orange: #d9730d; --yellow: #b58900; --green: #2e7d32; --grey: #78838f;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: .2rem 0 .4rem; }
h2 { font-size: 1.1rem; margin: 0 0 .7rem; }
h3 { font-size: 1rem; margin: 0 0 .6rem; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.ok { color: var(--green); font-weight: 600; }
.warn { color: var(--orange); }
[hidden] { display: none !important; }

/* top bar */
.topbar { display: flex; align-items: center; gap: 1rem; padding: .55rem 1.2rem; background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 800; font-size: 1.25rem; color: #fff; letter-spacing: -.02em; }
.brand span { color: #6fb1ff; }
.brand.big { font-size: 2rem; color: var(--brand); }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: .2rem; }
.topbar nav a { color: #cfd8e3; padding: .35rem .7rem; border-radius: 6px; }
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.quicksearch { flex: 1; max-width: 460px; margin-left: auto; }
.quicksearch input { width: 100%; border: 0; background: rgba(255,255,255,.14); color: #fff; }
.quicksearch input::placeholder { color: #aab7c6; }
.usermenu { position: relative; }
.usermenu summary { cursor: pointer; list-style: none; padding: .35rem .6rem; border-radius: 6px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: rgba(255,255,255,.12); }
.usermenu .menu { position: absolute; right: 0; top: 2.3rem; background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .7rem; min-width: 210px; box-shadow: 0 8px 24px rgba(0,0,0,.15); display: grid; gap: .5rem; }

main { max-width: 1280px; margin: 0 auto; padding: 1.2rem; }
main.login { display: grid; place-items: center; min-height: 100vh; }

/* building blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; width: 100%; }
.card.center, .card.empty { text-align: center; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .8rem; }
.btn { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: .45rem .9rem;
  border-radius: 6px; font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: #b9c3cf; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.wide { width: 100%; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-align: left; }
.linklike.danger { color: var(--red); }
form.inline { display: inline; margin-left: .4rem; }

input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], select, textarea {
  font: inherit; color: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc3ff; outline-offset: 0; border-color: var(--accent); }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .8rem; }
label > input, label > select, label > textarea { margin-top: .25rem; font-weight: normal; }
label.check { font-weight: normal; display: flex; gap: .5rem; align-items: center; }
label.check input { width: auto; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem .2rem; margin: 0 0 1rem; }
legend { font-weight: 600; font-size: .9rem; padding: 0 .3rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1rem; }
.span2 { grid-column: span 2; }
.actions { display: flex; gap: .6rem; }
.row { display: flex; gap: .6rem; align-items: center; }

.flash { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.flash.error { background: #fdecea; border-color: #f5c2bd; color: #8a1c13; }
.flash.success { background: #e8f5e9; border-color: #b9dfbb; color: #1b5e20; }
.flash.info { background: #e8f1fd; border-color: #bcd5f7; color: #0b3d80; }

/* badges */
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px;
  background: #eef1f5; color: #3d4754; margin-right: .2rem; white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.sev-critical { background: #fde0dc; color: var(--red); }
.sev-high { background: #fdebd8; color: var(--orange); }
.sev-medium { background: #fbf3d5; color: var(--yellow); }
.sev-low { background: #eef1f5; color: var(--grey); }
.status-new { background: #e3eefc; color: #0b55c7; }
.status-investigating { background: #efe5fb; color: #6a2fb5; }
.status-confirmed { background: #fde0dc; color: var(--red); }
.status-fixed { background: #e3f3e4; color: var(--green); }
.status-cannot_reproduce, .status-wont_fix, .status-duplicate { background: #eef1f5; color: var(--grey); }
.badge.known { background: #0b2340; color: #fff; }
.src-salesforce { background: #e0f2fe; color: #0369a1; }
.src-jira { background: #e0e7ff; color: #3730a3; }
.src-confluence { background: #dbeafe; color: #1e40af; }
.src-kb_public { background: #dcfce7; color: #166534; }
.src-kb_internal { background: #fef3c7; color: #92400e; }
.src-meeting { background: #fce7f3; color: #9d174d; }

/* filters & tables */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters input[type=search] { flex: 1 1 320px; width: auto; }
.filters select { width: auto; }
table.buglist { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.buglist th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #f8fafc; }
.buglist th, .buglist td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.buglist tr:last-child td { border-bottom: 0; }
.buglist tbody tr:hover { background: #f8fbff; }
.buglist td.key { font-weight: 700; white-space: nowrap; }
.buglist tr.warnrow td { background: #fff8f0; }
.pager { display: flex; gap: 1rem; justify-content: center; margin: 1rem 0; }
.tabs { display: flex; gap: .3rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .5rem .9rem; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

/* bug detail */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .topbar { flex-wrap: wrap; } }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; margin: 0; }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
blockquote.prose { margin: .4rem 0 0; padding: .5rem .8rem; border-left: 3px solid var(--line); background: #f8fafc; color: #39424e; font-size: .92rem; }
.sourcelist, .filelist, ul.plain, ul.known { list-style: none; margin: 0 0 .8rem; padding: 0; }
.sourcelist li, .filelist li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.sourcelist li:last-child, .filelist li:last-child { border-bottom: 0; }
ul.plain li { padding: .2rem 0; }
ul.known li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
ul.known li:last-child { border-bottom: 0; }
.addbox summary { cursor: pointer; color: var(--accent); font-weight: 600; margin: .4rem 0 .8rem; }
.timeline { list-style: none; margin: 0 0 1rem; padding: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 1rem 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.timeline li.ev-note::before { background: var(--accent); }
.timeline li.ev-publish::before { background: var(--brand); }
.timeline li.ev-change .prose { color: var(--muted); font-size: .9rem; }
.danger-zone { border-color: #f5c2bd; }

/* bug form */
.bugform .full { grid-column: 1 / -1; }
.similar { background: #fff8e6; border: 1px solid #f3d27a; border-radius: var(--radius); padding: .6rem .9rem; margin: -.3rem 0 1rem; }
.similar ul { margin: .3rem 0 0; padding-left: 1.2rem; }

/* known issue page */
.knownissue { max-width: 860px; margin: 0 auto; padding: 1.6rem 2rem; }
.knownissue h2 { margin-top: 1.4rem; }
.knownissue .footer { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: .8rem; }
