:root {
  --brand: #F18B30;
  --brand-dark: #D9731A;
  --ink: #282526;
  --ink-2: #55504f;
  --muted: #8a8483;
  --line: #e7e3e1;
  --bg: #f6f4f2;
  --card: #ffffff;
  --ok: #1f7a4d;
  --ok-bg: #e7f5ee;
  --err: #b3261e;
  --err-bg: #fdecea;
  --warn-bg: #fff4e5;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; font-size: 15px; line-height: 1.45; }
a { color: #b35c0e; }
a:hover { color: var(--brand-dark); }
h1 { font-size: 1.6rem; margin: 0 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 28px; padding-bottom: 40px; }
main.narrow { max-width: 460px; }
main.medium { max-width: 760px; }
main.full { max-width: none; padding-left: 24px; padding-right: 24px; }
.muted { color: var(--muted); }
.small, .hint { font-size: .85em; }
.hint { color: var(--muted); font-weight: normal; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }

/* header */
.top { background: #fff; border-bottom: 3px solid var(--brand); }
.top-inner { max-width: none; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.brand img { height: 54px; width: auto; display: block; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.on { color: var(--ink); background: #fdf0e3; box-shadow: inset 0 -2px 0 var(--brand); }
.me { display: flex; align-items: center; gap: 14px; font-size: .92em; }
.me .who { font-weight: 600; }
.me a { color: var(--ink-2); }
form.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font: inherit; }
.banner.warn { background: var(--warn-bg); border-bottom: 1px solid #f3d6ad; padding: 10px 0; font-size: .95em; }
.foot { color: var(--muted); font-size: .82em; padding: 18px 0; border-top: 1px solid var(--line); background: #fff; }

/* cards and forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(40, 37, 38, .04); }
.card.login { margin-top: 40px; }
.card.danger { border-color: #f1c6c2; }
label { display: block; font-weight: 600; font-size: .92em; margin-bottom: 14px; }
input[type=text], input:not([type]), input[type=password], input[type=search], input[type=date], select {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px; border: 1px solid #d6d0cd; border-radius: 8px;
  font: inherit; font-weight: normal; background: #fff; color: var(--ink);
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px 4px; margin: 0 0 16px; }
legend { font-weight: 700; font-size: .92em; padding: 0 6px; }
label.check { display: flex; align-items: baseline; gap: 8px; font-weight: 500; }
label.check input { margin: 0; }
button, .button {
  display: inline-block; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid #d6d0cd; background: #fff; color: var(--ink); text-decoration: none; line-height: 1.2;
}
button:hover, .button:hover { border-color: var(--ink-2); color: var(--ink); }
button.primary, .button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
button.danger { background: var(--err); border-color: var(--err); color: #fff; }
button.wide { width: 100%; margin-top: 6px; padding: 11px; }
.actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.row-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row-form label { flex: 1; min-width: 220px; margin-bottom: 0; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: .95em; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--err-bg); color: var(--err); }

/* home tiles */
h2.group { margin-top: 28px; color: var(--ink-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--ink); transition: box-shadow .15s, transform .15s; }
.tile:hover { box-shadow: 0 6px 18px rgba(40, 37, 38, .08); transform: translateY(-1px); color: var(--ink); }
.tile-title { font-weight: 700; font-size: 1.05rem; }
.tile-text { color: var(--ink-2); font-size: .92em; }

/* tables */
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.head-row h1 { margin: 0; }
.eyebrow { margin: 0 0 2px; color: var(--brand-dark); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table.grid { width: 100%; border-collapse: collapse; font-size: .9em; }
table.grid th, table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.grid th { background: #faf8f7; font-size: .8em; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); position: sticky; top: 0; white-space: nowrap; }
table.grid tbody tr:hover { background: #fffaf4; }
table.grid tr.dim td { color: var(--muted); }
table.compact td { padding: 6px 12px; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]::after { content: " ↕"; color: #c9c2bf; }
th.sorted-asc::after { content: " ↑"; color: var(--brand-dark); }
th.sorted-desc::after { content: " ↓"; color: var(--brand-dark); }
td.title { min-width: 320px; }
.pill { display: inline-block; font-size: .75em; background: #fdf0e3; color: #b35c0e; border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.yes { color: var(--ok); font-weight: 700; }

/* user stories */
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.toolbar label { margin: 0; font-size: .82em; }
.toolbar select { min-width: 200px; }
.summary { margin: 4px 0 10px; }
.summary .big { font-size: 1.5rem; font-weight: 700; color: var(--brand-dark); margin-right: 4px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { padding: 5px 12px; border-radius: 999px; font-weight: 500; font-size: .88em; background: #fff; }
.chip b { margin-left: 4px; color: var(--ink-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on b { color: #fff; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filters input, .filters select { width: auto; margin: 0; min-width: 200px; }
.filters input[type=search] { min-width: 280px; }
.state { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .85em; font-weight: 600; background: #eeeae8; color: var(--ink-2); }
.state[data-s=new], .state[data-s=design] { background: #eaf1fb; color: #24589b; }
.state[data-s=active], .state[data-s=testing], .state[data-s=review], .state[data-s=under-analysis] { background: #fdf0e3; color: #a3530b; }
.state[data-s=resolved], .state[data-s=ready-for-uat], .state[data-s=ready-for-production], .state[data-s=uat-deployment] { background: #f1ecfb; color: #5b3d9c; }
.state[data-s=closed], .state[data-s=deployed], .state[data-s=done] { background: var(--ok-bg); color: var(--ok); }
.state[data-s=blocked], .state[data-s=on-hold], .state[data-s=removed] { background: var(--err-bg); color: var(--err); }
.tag { display: inline-block; background: #f3f0ee; border-radius: 4px; padding: 1px 6px; margin: 0 4px 3px 0; font-size: .82em; color: var(--ink-2); }

@media (max-width: 720px) {
  .top-inner { padding: 10px 16px; gap: 12px; }
  .brand img { height: 42px; }
  main.full { padding-left: 16px; padding-right: 16px; }
  .filters input, .filters select, .filters input[type=search], .toolbar select { min-width: 0; width: 100%; }
}
