* { box-sizing: border-box; }
/* Font, colour and background belong to theme.css. This rule loads after it,
   so redeclaring them here silently overrides the brand - which is exactly
   what happened to the sans until an e2e test caught it. */
body { margin: 0; font-size: 14px; }
a { color: var(--accent); }
button { font-family: inherit; }

/* Topbar */
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 46px; background: var(--espresso); color: var(--line); }
.topbar a { color: var(--line); text-decoration: none; font-size: 13px; }
.topbar a:hover { color: var(--surface); }
.topbar .brand { font-weight: 700; font-size: 15px; color: var(--surface); }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: var(--text-faint); }
.btn-link { background: none; border: none; color: var(--line); cursor: pointer; font-size: 13px; padding: 0; }
.btn-link:hover { color: var(--surface); }

/* Buttons, inputs */
.btn-primary { background: var(--accent); color: var(--surface); border: 1px solid var(--accent-strong); border-radius: var(--r-pill); padding: 7px 14px; font-size: 13px; cursor: pointer; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 7px 14px; font-size: 13px; cursor: pointer; }
.btn-secondary:hover { background: var(--surface-sunk); }
.btn-sm { font-size: 12px; padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid var(--line); cursor: pointer; background: var(--surface); }
.btn-sm:hover { background: var(--surface-sunk); }
.input { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 10px; font-size: 13px; background: var(--surface); }
.input:focus { outline: none; border-color: var(--accent); }
.select { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 10px; font-size: 13px; background: var(--surface); width: 100%; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-muted); display: block; }
.status-ok { font-size: 12px; color: var(--ok); }
.status-err { font-size: 13px; color: var(--danger); }

/* Page scaffold */
.page-wrap { max-width: 1180px; margin: 0 auto; padding: 20px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.page-header h2 { margin: 0; font-size: 20px; }

/* Login */
.login-box { max-width: 340px; margin: 90px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 26px; }
.login-box h1 { margin: 0 0 18px; font-size: 20px; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }

/* Boards index */
.boards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.board-tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px; text-decoration: none; color: inherit; }
.board-tile:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); border-color: var(--line); }
.board-tile-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.board-tile-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.4; }
.board-tile-meta { font-size: 12px; color: var(--text-faint); }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.45); overflow-y: auto; }
.modal { background: var(--surface); border-radius: 8px; width: calc(100% - 32px); margin: 60px auto; box-shadow: 0 8px 40px rgba(0,0,0,.3); }
.modal-hdr { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }

/* Badges */
.type-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.type-feature { background: var(--info-wash); color: var(--info); }
.type-bug { background: var(--danger-wash); color: var(--danger); }
.type-plan { background: var(--special-wash); color: var(--special); }
.priority-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700; }
.priority-low { background: var(--ok-wash); color: var(--ok); }
.priority-medium { background: var(--warn-wash); color: var(--warn); }
.priority-high { background: var(--warn-wash); color: var(--warn); }
.priority-critical { background: var(--danger-wash); color: var(--danger); }
.deployed-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700; background: var(--ok-wash); color: var(--ok); }
.due-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; background: var(--accent-wash); color: var(--accent-strong); }
.due-overdue { background: var(--danger-wash); color: var(--danger); }
.card-age { display: inline-block; padding: 1px 5px; border-radius: 3px; font-size: 10px; }
.card-age-green { background: var(--ok-wash); color: var(--ok); }
.card-age-amber { background: var(--warn-wash); color: var(--warn); }
.card-age-red { background: var(--danger-wash); color: var(--danger); }
.type-pick-btn { display: flex; align-items: center; gap: 12px; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; cursor: pointer; text-align: left; width: 100%; }
.type-pick-btn:hover { background: var(--info-wash); border-color: var(--info-wash); }
.type-pick-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.archive-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border: 1px solid var(--line-soft); border-radius: 6px; gap: 10px; }
.archive-row-title { font-weight: 500; font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------------------
   Brand surfaces. Values only — every selector above is unchanged, so the e2e
   suite still finds what it looks for.
   --------------------------------------------------------------------------- */

.topbar {
  background: var(--ink);
  color: var(--cream);
  height: 52px;
  border-bottom: 1px solid color-mix(in srgb, var(--cream) 10%, transparent);
}
.topbar a { color: var(--cream); opacity: .82; }
.topbar a:hover { color: var(--terracotta); opacity: 1; }
.topbar .brand {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cream);
  opacity: 1;
}
.topbar .who { color: var(--taupe); text-transform: none; letter-spacing: 0; }
.btn-link { color: var(--cream); opacity: .82; }
.btn-link:hover { color: var(--terracotta); opacity: 1; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 16px;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); transform: translateY(-1px); }
.btn-secondary, .btn-sm { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn-secondary:hover, .btn-sm:hover { background: var(--surface-sunk); border-color: var(--taupe); }

.input:focus, .select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-color: var(--accent);
}

.page-header h2 { font-family: var(--serif); font-size: 26px; color: var(--espresso); }

.board-tile, .login-box, .modal {
  border-radius: var(--r-lg);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.board-tile:hover { box-shadow: var(--shadow-md); border-color: var(--taupe); }

/* Brand mark. The full lockup is mark-over-wordmark, so at topbar height its
   wordmark would be a few pixels tall - the mark alone is paired with a text
   wordmark instead. alt="" because the adjacent text already names it, and a
   screen reader should not hear the name twice. */
.topbar .brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-mark { height: 30px; width: auto; display: block; }

.login-box { text-align: center; }
.login-box .login-logo {
  height: 92px;
  width: auto;
  margin: 0 auto 6px;
  display: block;
}
.login-box h1 { font-family: var(--serif); font-size: 19px; color: var(--espresso); margin: 0 0 18px; }
.login-box form { text-align: left; }


/* Reused outside the board pages (warehouse crumbs/keys/panels and the
   ticket jump box, which rides on pages that do not load boards.css). */
.tk-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-faint); margin-bottom: 10px; flex-wrap: wrap; }
.tk-crumbs a { color: var(--text-muted); text-decoration: none; }
.tk-crumbs a:hover { text-decoration: underline; }
.tk-key { font-family: monospace; font-weight: 700; color: var(--text); }
.tk-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; }
.tk-panel h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); margin: 0 0 12px; }
.tjump { display: flex; align-items: center; gap: 6px; margin: 0; }
.tjump-go { font-size: 13px; line-height: 1.2; padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text-muted); cursor: pointer; }
.tjump-go:hover { background: var(--surface-sunk); color: var(--ink); }
.tjump-err { font-size: 12px; color: var(--danger); white-space: nowrap; }
