/* AX-PROJECT - Atlassian-flavoured design tokens ---------------------------- */
:root {
  --n0:#FFFFFF; --n10:#FAFBFC; --n20:#F4F5F7; --n30:#EBECF0; --n40:#DFE1E6;
  --n50:#C1C7D0; --n70:#A5ADBA; --n200:#6B778C; --n400:#505F79; --n500:#42526E;
  --n800:#172B4D;
  --blue:#0052CC; --blue-hover:#0065FF; --blue-light:#DEEBFF; --blue-dark:#0747A6;
  --green:#36B37E; --green-light:#E3FCEF; --green-dark:#006644;
  --yellow:#FFAB00; --yellow-light:#FFF0B3; --yellow-dark:#974F0C;
  --red:#FF5630; --red-light:#FFEBE6; --red-dark:#BF2600;
  --purple:#6554C0; --purple-light:#EAE6FF; --teal:#00B8D9;
  /* Accxia brand accents, used for the wordmark only */
  --ax-petrol:#007FA0; --ax-charcoal:#3b3f44; --ax-gold:#C7A24B;
  --shadow-card:0 1px 1px rgba(9,30,66,.25), 0 0 1px rgba(9,30,66,.31);
  --shadow-overlay:0 8px 16px -4px rgba(9,30,66,.25), 0 0 1px rgba(9,30,66,.31);
  --radius:3px;
  --topnav-h:56px;
  --sidebar-w:240px;
  --font:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing:border-box; }
/* Author rules that set `display` would otherwise beat the user agent's
   [hidden] { display:none } - keep the attribute authoritative. */
[hidden] { display:none !important; }
html, body { height:100%; }
body {
  margin:0; font-family:var(--font); font-size:14px; color:var(--n800);
  background:var(--n0); -webkit-font-smoothing:antialiased;
}
button, input, select, textarea { font-family:inherit; font-size:inherit; color:inherit; }
a { color:var(--blue); text-decoration:none; }
a:hover { text-decoration:underline; }
:focus-visible { outline:2px solid var(--blue); outline-offset:2px; border-radius:2px; }
::-webkit-scrollbar { width:8px; height:8px; }
::-webkit-scrollbar-thumb { background:var(--n50); border-radius:4px; }

/* --- top navigation ------------------------------------------------------ */
.topnav {
  position:fixed; inset:0 0 auto 0; height:var(--topnav-h); z-index:400;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:0 16px; background:var(--n0); border-bottom:1px solid var(--n40);
}
.topnav-left, .topnav-right { display:flex; align-items:center; gap:8px; }
.brand { display:flex; align-items:center; gap:8px; margin-right:8px; color:var(--n800); }
.brand:hover { text-decoration:none; }
.brand-mark {
  position:relative; width:26px; height:26px; border-radius:6px;
  background:var(--ax-petrol); flex:none;
}
.brand-mark::after {
  content:""; position:absolute; inset:7px; background:var(--ax-gold);
  clip-path:polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.brand-name {
  font-weight:700; font-size:15px; letter-spacing:.6px; color:var(--ax-charcoal);
  text-transform:uppercase;
}
.topnav-links { display:flex; align-items:center; gap:2px; }
.nav-menu { position:relative; }
.nav-btn {
  background:none; border:0; padding:6px 10px; border-radius:var(--radius);
  color:var(--n500); font-weight:500; cursor:pointer;
}
.nav-btn:hover { background:var(--n20); color:var(--n800); }
.nav-btn.active { color:var(--blue); }
.caret { border:4px solid transparent; border-top-color:currentColor; display:inline-block;
  margin-left:4px; transform:translateY(2px); }
.btn-create { margin-left:6px; }

.quick-search { position:relative; display:flex; align-items:center; }
.quick-search .icon { position:absolute; left:8px; width:16px; height:16px; fill:var(--n200); }
.quick-search input {
  width:220px; padding:6px 8px 6px 30px; border:2px solid var(--n40); border-radius:var(--radius);
  background:var(--n10);
}
.quick-search input:focus { outline:none; border-color:var(--blue); background:var(--n0); width:320px; }
.search-results { width:420px; max-height:420px; overflow:auto; }

.avatar-btn { background:none; border:0; padding:2px; cursor:pointer; border-radius:50%; }
.avatar {
  display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px;
  border-radius:50%; background:var(--blue); color:#fff; font-size:11px; font-weight:600;
  letter-spacing:.3px; flex:none; text-transform:uppercase;
}
.avatar.sm { width:24px; height:24px; font-size:10px; }
.avatar.lg { width:40px; height:40px; font-size:14px; }
.avatar.none { background:var(--n30); color:var(--n200); }

/* --- dropdown ------------------------------------------------------------ */
.dropdown {
  position:absolute; top:calc(100% + 6px); left:0; min-width:240px; padding:8px 0;
  background:var(--n0); border-radius:var(--radius); box-shadow:var(--shadow-overlay);
  z-index:500; max-height:70vh; overflow:auto;
}
.dropdown-right { left:auto; right:0; }
.dropdown-title {
  padding:6px 16px; font-size:11px; font-weight:700; color:var(--n200);
  text-transform:uppercase; letter-spacing:.5px;
}
.dropdown-item {
  display:flex; align-items:center; gap:10px; width:100%; padding:8px 16px; border:0;
  background:none; text-align:left; cursor:pointer; color:var(--n800);
}
.dropdown-item:hover { background:var(--n20); text-decoration:none; }
.dropdown-item.selected { background:var(--blue-light); color:var(--blue-dark); }
.dropdown-item small { display:block; color:var(--n200); font-size:12px; }
.dropdown-sep { height:1px; background:var(--n30); margin:8px 0; }

/* --- layout -------------------------------------------------------------- */
.layout { display:flex; padding-top:var(--topnav-h); height:100%; }
.sidebar {
  width:var(--sidebar-w); flex:none; background:var(--n20); border-right:1px solid var(--n40);
  height:calc(100vh - var(--topnav-h)); overflow-y:auto; padding:16px 8px 32px;
  position:sticky; top:var(--topnav-h);
}
.content { flex:1; min-width:0; height:calc(100vh - var(--topnav-h)); overflow:auto; padding:24px 32px 64px; }
.content.flush { padding:16px 24px 24px; }

.side-project { display:flex; gap:10px; align-items:center; padding:8px; margin-bottom:12px; }
.project-avatar {
  width:32px; height:32px; border-radius:var(--radius); display:flex; align-items:center;
  justify-content:center; color:#fff; font-weight:700; font-size:13px; flex:none;
}
.side-project b { display:block; font-size:14px; line-height:1.2; }
.side-project small { color:var(--n200); font-size:12px; text-transform:capitalize; }
.side-link {
  display:flex; align-items:center; gap:10px; padding:7px 10px; border-radius:var(--radius);
  color:var(--n500); font-weight:500; cursor:pointer; border:0; background:none; width:100%;
  text-align:left;
}
.side-link:hover { background:var(--n30); text-decoration:none; color:var(--n800); }
.side-link.active { background:var(--blue-light); color:var(--blue-dark); font-weight:600; }
.side-heading {
  padding:14px 10px 6px; font-size:11px; font-weight:700; color:var(--n200);
  text-transform:uppercase; letter-spacing:.5px;
}
.side-icon { width:16px; height:16px; fill:currentColor; flex:none; }

/* --- generic controls ---------------------------------------------------- */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:6px 12px;
  border:0; border-radius:var(--radius); background:var(--n30); color:var(--n500);
  font-weight:500; cursor:pointer; white-space:nowrap;
}
.btn:hover { background:var(--n40); }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-primary { background:var(--blue); color:#fff; }
.btn-primary:hover { background:var(--blue-hover); }
.btn-subtle { background:transparent; }
.btn-subtle:hover { background:var(--n30); }
.btn-danger { background:var(--red-dark); color:#fff; }
.btn-danger:hover { background:var(--red); }
.btn-sm { padding:3px 8px; font-size:12px; }
.btn-icon { padding:6px; width:32px; }

.field { margin-bottom:16px; }
.field label { display:block; font-size:12px; font-weight:600; color:var(--n500); margin-bottom:4px; }
.input, select.input, textarea.input {
  width:100%; padding:7px 8px; border:2px solid var(--n40); border-radius:var(--radius);
  background:var(--n10); color:var(--n800);
}
.input:focus { outline:none; border-color:var(--blue); background:var(--n0); }
textarea.input { min-height:96px; resize:vertical; line-height:1.5; }
.hint { font-size:12px; color:var(--n200); margin-top:4px; }
.row { display:flex; gap:12px; }
.row > * { flex:1; min-width:0; }

.lozenge {
  display:inline-block; padding:2px 6px; border-radius:var(--radius); font-size:11px;
  font-weight:700; text-transform:uppercase; letter-spacing:.3px; line-height:16px;
  background:var(--n30); color:var(--n500); white-space:nowrap;
}
.lozenge.todo { background:var(--n30); color:var(--n500); }
.lozenge.inprogress { background:var(--blue-light); color:var(--blue-dark); }
.lozenge.done { background:var(--green-light); color:var(--green-dark); }
.tag {
  display:inline-block; padding:2px 6px; border-radius:var(--radius); background:var(--n30);
  color:var(--n500); font-size:12px; margin:0 4px 4px 0;
}

.type-icon, .prio-icon { width:16px; height:16px; border-radius:3px; flex:none; }
.type-icon { display:inline-flex; align-items:center; justify-content:center; }
.type-icon svg { width:11px; height:11px; fill:#fff; }
.prio-icon svg { width:14px; height:14px; }

.page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px;
  margin-bottom:20px; flex-wrap:wrap; }
.page-head h1 { font-size:20px; margin:0 0 4px; font-weight:600; letter-spacing:-.2px; }
.breadcrumb { font-size:12px; color:var(--n200); margin-bottom:6px; }
.breadcrumb a { color:var(--n200); }
.head-actions { display:flex; gap:8px; align-items:center; }

.empty {
  padding:48px 24px; text-align:center; color:var(--n200); background:var(--n10);
  border-radius:var(--radius); border:1px dashed var(--n40);
}
.empty b { display:block; color:var(--n500); margin-bottom:4px; font-size:15px; }

/* --- board --------------------------------------------------------------- */
.board-toolbar { display:flex; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.avatar-filter { display:flex; }
.avatar-filter .avatar { margin-left:-6px; border:2px solid var(--n0); cursor:pointer; }
.avatar-filter .avatar.dim { opacity:.35; }
.board-columns { display:flex; gap:8px; align-items:flex-start; overflow-x:auto; padding-bottom:16px; }
.board-col {
  flex:1 0 270px; max-width:340px; background:var(--n20); border-radius:var(--radius);
  padding:8px; display:flex; flex-direction:column; min-height:120px;
}
.board-col.over { background:var(--blue-light); }
.board-col.wip-exceeded { background:var(--red-light); }
.board-col-head {
  display:flex; align-items:center; justify-content:space-between; padding:4px 6px 10px;
  font-size:12px; font-weight:700; color:var(--n200); text-transform:uppercase; letter-spacing:.4px;
}
.board-col-head .count { font-weight:600; }
.board-col-body { display:flex; flex-direction:column; gap:6px; min-height:40px; }

.card {
  background:var(--n0); border-radius:var(--radius); box-shadow:var(--shadow-card);
  padding:10px; cursor:pointer; border-left:3px solid transparent;
}
.card:hover { background:var(--n10); }
.card.dragging { opacity:.4; }
.card-summary { line-height:1.4; margin-bottom:8px; word-break:break-word; }
.card-epic {
  display:inline-block; font-size:11px; font-weight:600; padding:1px 6px; border-radius:3px;
  color:#fff; margin-bottom:6px; max-width:100%; overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap;
}
.card-labels { margin-bottom:4px; }
.card-foot { display:flex; align-items:center; gap:6px; }
.card-key { font-size:12px; color:var(--n200); font-weight:500; }
.card-key.done { text-decoration:line-through; }
.card-foot .spacer { flex:1; }
.points {
  background:var(--n30); color:var(--n500); border-radius:10px; padding:0 7px; font-size:11px;
  font-weight:700; line-height:18px; min-width:20px; text-align:center;
}
.card-meta { display:inline-flex; align-items:center; gap:3px; font-size:11px; color:var(--n200); }

/* --- backlog ------------------------------------------------------------- */
.backlog-group { margin-bottom:16px; border:1px solid var(--n40); border-radius:var(--radius);
  background:var(--n10); }
.backlog-head {
  display:flex; align-items:center; gap:10px; padding:10px 12px; flex-wrap:wrap;
  border-bottom:1px solid transparent;
}
.backlog-head.open { border-bottom-color:var(--n40); }
.backlog-head h3 { margin:0; font-size:14px; }
.backlog-head .meta { color:var(--n200); font-size:12px; }
.backlog-head .spacer { flex:1; }
.chip-group { display:flex; gap:4px; }
.chip { border-radius:10px; padding:0 8px; font-size:11px; font-weight:700; line-height:18px;
  color:#fff; }
.chip.todo { background:var(--n70); }
.chip.inprogress { background:var(--blue); }
.chip.done { background:var(--green); }
.backlog-list { list-style:none; margin:0; padding:0; background:var(--n0); }
.backlog-list.over, .backlog-group.over .backlog-list { background:var(--blue-light); }
.backlog-row {
  display:flex; align-items:center; gap:8px; padding:6px 12px; border-bottom:1px solid var(--n30);
  cursor:pointer;
}
.backlog-row:hover { background:var(--n20); }
.backlog-row.dragging { opacity:.4; }
.backlog-row .summary { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap; }
.backlog-row .key { color:var(--n200); font-size:12px; min-width:74px; }
.backlog-empty { padding:16px; text-align:center; color:var(--n200); font-size:13px;
  border:1px dashed var(--n40); margin:8px; border-radius:var(--radius); }
.inline-create { display:flex; gap:8px; padding:8px 12px; border-top:1px solid var(--n30);
  background:var(--n0); }
.inline-create .input { flex:1; }

/* --- issue table --------------------------------------------------------- */
.issue-table { width:100%; border-collapse:collapse; background:var(--n0); }
.issue-table th {
  text-align:left; font-size:12px; color:var(--n200); font-weight:600; padding:8px 10px;
  border-bottom:2px solid var(--n40); position:sticky; top:0; background:var(--n0); z-index:1;
  white-space:nowrap; cursor:pointer;
}
.issue-table td { padding:8px 10px; border-bottom:1px solid var(--n30); vertical-align:middle; }
.issue-table tr { cursor:pointer; }
.issue-table tbody tr:hover { background:var(--n20); }
.issue-table tr.selected { background:var(--blue-light); }
.issue-table .nowrap { white-space:nowrap; }
.table-wrap { border:1px solid var(--n40); border-radius:var(--radius); overflow:auto;
  max-height:calc(100vh - 260px); }

.jql-bar { display:flex; gap:8px; margin-bottom:12px; }
.jql-bar .input { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:13px; }
.jql-error { color:var(--red-dark); background:var(--red-light); padding:8px 12px;
  border-radius:var(--radius); margin-bottom:12px; font-size:13px; }

/* --- issue detail panel -------------------------------------------------- */
.panel-backdrop { position:fixed; inset:0; background:rgba(9,30,66,.35); z-index:600; }
.issue-panel {
  position:fixed; top:0; right:0; bottom:0; width:min(920px, 92vw); background:var(--n0);
  z-index:610; box-shadow:var(--shadow-overlay); display:flex; flex-direction:column;
}
.panel-head {
  display:flex; align-items:center; gap:8px; padding:12px 20px; border-bottom:1px solid var(--n40);
}
.panel-head .spacer { flex:1; }
.panel-body { flex:1; overflow:auto; padding:20px 24px 48px; display:grid;
  grid-template-columns:1fr 320px; gap:28px; align-items:start; }
@media (max-width:900px) { .panel-body { grid-template-columns:1fr; } }
.issue-title { font-size:22px; font-weight:600; margin:0 0 16px; line-height:1.3; }
.issue-title[contenteditable]:focus, .editable:focus { outline:none; background:var(--n0);
  box-shadow:0 0 0 2px var(--blue); border-radius:var(--radius); }
.editable { padding:4px 6px; margin:-4px -6px; border-radius:var(--radius); cursor:text; }
.editable:hover { background:var(--n20); }
.section-label { font-size:12px; font-weight:600; color:var(--n500); margin:20px 0 6px; }
.desc-body { line-height:1.6; white-space:pre-wrap; min-height:40px; color:var(--n800); }
.desc-body:empty::before { content:"Add a description..."; color:var(--n200); }

.detail-card { border:1px solid var(--n40); border-radius:var(--radius); }
.detail-card h4 { margin:0; padding:8px 12px; font-size:12px; color:var(--n500);
  border-bottom:1px solid var(--n40); background:var(--n10); }
.detail-grid { display:grid; grid-template-columns:96px 1fr; gap:8px 12px; padding:12px;
  align-items:center; font-size:13px; }
.detail-grid > .k { color:var(--n200); font-size:12px; font-weight:600; }
.detail-grid select, .detail-grid input { width:100%; padding:4px 6px; border:2px solid transparent;
  border-radius:var(--radius); background:transparent; }
.detail-grid select:hover, .detail-grid input:hover { background:var(--n20); }
.detail-grid select:focus, .detail-grid input:focus { outline:none; border-color:var(--blue);
  background:var(--n0); }
.people-row { display:flex; align-items:center; gap:8px; }

.tabs { display:flex; gap:4px; border-bottom:2px solid var(--n30); margin:24px 0 12px; }
.tab { padding:6px 10px; border:0; background:none; cursor:pointer; color:var(--n500);
  font-weight:500; border-bottom:2px solid transparent; margin-bottom:-2px; }
.tab.active { color:var(--blue); border-bottom-color:var(--blue); }

.comment { display:flex; gap:10px; margin-bottom:16px; }
.comment .body { flex:1; }
.comment .who { font-weight:600; margin-right:8px; }
.comment .when { color:var(--n200); font-size:12px; }
.comment .text { margin-top:4px; line-height:1.5; white-space:pre-wrap; }
.comment .actions { margin-top:4px; display:flex; gap:8px; }
.comment .actions button { background:none; border:0; color:var(--n200); font-size:12px;
  cursor:pointer; padding:0; font-weight:600; }
.comment .actions button:hover { text-decoration:underline; }
.history-row { display:flex; gap:10px; padding:8px 0; border-bottom:1px solid var(--n30);
  font-size:13px; }
.history-row .when { color:var(--n200); font-size:12px; }
.subtask-row { display:flex; align-items:center; gap:8px; padding:6px 8px;
  border:1px solid var(--n30); border-radius:var(--radius); margin-bottom:4px; cursor:pointer; }
.subtask-row:hover { background:var(--n20); }
.progress { height:6px; background:var(--n30); border-radius:3px; overflow:hidden; }
.progress > span { display:block; height:100%; background:var(--green); }

/* --- modal --------------------------------------------------------------- */
.modal-root { position:fixed; inset:0; background:rgba(9,30,66,.54); z-index:700; display:flex;
  align-items:flex-start; justify-content:center; padding:56px 16px; overflow:auto; }
.modal { background:var(--n0); border-radius:var(--radius); box-shadow:var(--shadow-overlay);
  width:min(680px, 100%); }
.modal.wide { width:min(900px, 100%); }
.modal-head { padding:20px 24px 8px; font-size:20px; font-weight:600; }
.modal-body { padding:8px 24px 20px; max-height:66vh; overflow:auto; }
.modal-foot { padding:12px 24px 20px; display:flex; justify-content:flex-end; gap:8px; }

/* --- reports ------------------------------------------------------------- */
.report-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(320px, 1fr)); gap:16px; }
.panel-card { border:1px solid var(--n40); border-radius:var(--radius); padding:16px;
  background:var(--n0); }
.panel-card h3 { margin:0 0 12px; font-size:14px; }
.legend { display:flex; gap:16px; flex-wrap:wrap; font-size:12px; color:var(--n500);
  margin-top:8px; }
.legend i { display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:5px; }
.bar-row { display:grid; grid-template-columns:120px 1fr 44px; align-items:center; gap:8px;
  margin-bottom:6px; font-size:13px; }
.bar-track { background:var(--n30); border-radius:2px; height:14px; overflow:hidden; }
.bar-fill { display:block; height:100%; }
.stat-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(140px,1fr)); gap:12px;
  margin-bottom:20px; }
.stat { border:1px solid var(--n40); border-radius:var(--radius); padding:14px 16px; }
.stat b { display:block; font-size:26px; font-weight:600; line-height:1.1; }
.stat span { color:var(--n200); font-size:12px; }

/* --- roadmap ------------------------------------------------------------- */
.epic-row { border:1px solid var(--n40); border-radius:var(--radius); margin-bottom:8px;
  overflow:hidden; }
.epic-head { display:flex; align-items:center; gap:10px; padding:10px 12px; cursor:pointer; }
.epic-head:hover { background:var(--n10); }
.epic-bar { flex:1; max-width:340px; }
.epic-children { border-top:1px solid var(--n30); }

/* --- toast --------------------------------------------------------------- */
.toast-stack { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); z-index:800;
  display:flex; flex-direction:column; gap:8px; align-items:center; pointer-events:none; }
.toast { pointer-events:auto; background:var(--n800); color:#fff; padding:10px 16px; border-radius:var(--radius);
  box-shadow:var(--shadow-overlay); font-size:13px; animation:rise .18s ease-out; }
.toast.error { background:var(--red-dark); }
@keyframes rise { from { opacity:0; transform:translateY(8px); } }

@media (prefers-reduced-motion:reduce) { * { animation:none !important; transition:none !important; } }
@media (max-width:820px) {
  .sidebar { display:none; }
  .topnav-links, .quick-search input { display:none; }
  .content { padding:16px; }
}
