:root {
  --bg: #f5f6f8; --card: #fff; --text: #1f2933; --muted: #6b7785; --line: #dde1e7;
  --accent: #e8590c; --accent-dark: #c44a08; --ok: #2b8a3e; --err: #c92a2a; --warn: #e67700;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
header.top { background: #1f2933; color: #fff; padding: 0 24px; display: flex; align-items: center; gap: 24px; min-height: 52px; flex-wrap: wrap; }
header.top .brand { font-weight: 700; letter-spacing: .3px; }
header.top .brand span { color: var(--accent); }
header.top nav { display: flex; gap: 16px; flex: 1; flex-wrap: wrap; }
header.top a { color: #d3d9e0; text-decoration: none; }
header.top a:hover { color: #fff; }
header.top .who { color: #9aa5b1; font-size: 13px; display: flex; align-items: center; gap: 10px; }
main { max-width: 1100px; margin: 24px auto; padding: 0 24px; }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 28px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.stat b { display: block; font-size: 26px; }
.stat span { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #eef0f3; font-size: 13px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 4px 14px 4px 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=file], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #c4cad2; border-radius: 6px; font: inherit; background: #fff; }
input[readonly] { background: #eef0f3; color: var(--muted); }
textarea { min-height: 90px; }
.row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .row { grid-template-columns: 1fr; } }
.btn, button { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 8px 16px; font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover, button:hover { background: var(--accent-dark); }
.btn.secondary, button.secondary { background: #e4e7ec; color: var(--text); }
.btn.success, button.success { background: var(--ok); }
.btn.success:hover, button.success:hover { background: #237032; }
.btn.danger, button.danger { background: var(--err); }
.btn.danger:hover, button.danger:hover { background: #a61e1e; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.waiting::before, .btn.waiting::before { content: "\231B\FE0F "; display: inline-block; animation: flip 1.2s infinite; }
@keyframes flip { 0%, 40% { transform: rotate(0); } 60%, 100% { transform: rotate(180deg); } }
#jira-wait { position: fixed; right: 20px; bottom: 20px; background: #1f2933; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.25); display: none; z-index: 50; }
#jira-wait.on { display: block; }
#jira-wait span { display: inline-block; animation: flip 1.2s infinite; }
button.link { background: none; color: #d3d9e0; padding: 0; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
.flash.ok { background: #d3f9d8; color: #14532d; }
.flash.error { background: #ffe3e3; color: #7f1d1d; }
.errors { background: #ffe3e3; color: #7f1d1d; border-radius: 6px; padding: 10px 14px 10px 30px; margin-bottom: 14px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; background: #e4e7ec; }
.badge.approved, .badge.on { background: #d3f9d8; color: #14532d; }
.badge.submitted, .badge.returned { background: #fff3bf; color: #7a4a00; }
.badge.invited { background: #d0ebff; color: #0b4a75; }
.badge.inactive, .badge.off { background: #ffe3e3; color: #7f1d1d; }
.muted { color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.actions form { margin: 0; }
dl.facts { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; word-break: break-word; }
.check.ok::before { content: "✔ "; color: var(--ok); }
.check.bad::before { content: "✘ "; color: var(--err); }
.login { max-width: 380px; margin: 60px auto; }
code { background: #eef0f3; padding: 1px 5px; border-radius: 4px; font-size: 13px; }

/* "..." row menu opened on hover (or keyboard focus / tap) */
table.menu-table { overflow: visible; }
.menu-col { width: 56px; text-align: right; }
.menu { position: relative; display: inline-block; }
.menu-btn { background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 2px 10px; border-radius: 6px; }
.menu-btn:hover, .menu:focus-within .menu-btn { background: #e4e7ec; color: var(--text); }
.menu-list { display: none; position: absolute; right: 0; top: 100%; z-index: 20; min-width: 170px; margin: 0; padding: 4px;
  list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .14); text-align: left; }
.menu:hover .menu-list, .menu:focus-within .menu-list { display: block; }
.menu-item { display: block; width: 100%; text-align: left; background: none; color: var(--text); border-radius: 6px; padding: 8px 12px; }
.menu-item:hover { background: #eef0f3; }
.menu-item.menu-danger { color: var(--err); }
.menu-item.menu-danger:hover { background: #ffe3e3; }

dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; width: min(440px, 92vw); color: var(--text); }
dialog::backdrop { background: rgba(31, 41, 51, .5); }
dialog form { padding: 20px 22px; }
button:disabled { opacity: .5; cursor: not-allowed; }

#confirm-dialog { border: 0; border-radius: 10px; padding: 22px 24px; max-width: 460px; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
#confirm-dialog::backdrop { background: rgba(31,41,51,.5); }
#confirm-dialog.warning { border-top: 6px solid var(--err); background: #fff5f5; }
#confirm-dialog.warning h2 { color: var(--err); }
